<?php
session_start();
$goodsname = $_GET["goodsname"];
$price = $_GET['price'];
$goodsprice=$price ;
$goods = $_SESSION["goods"];

 if($goodsname == $goods[$goodsname]['goodsname']){
 $goods[$goodsname]['number'] = $goods[$goodsname]['number']+1;
 $_SESSION['totalprice'] = $_SESSION['totalprice']+$price;
 $goods[$goodsname]['goodsprice']=$goods[$goodsname]['number']*$price;
 $_SESSION['totalnum']=$_SESSION['totalnum']+1;
 }

$_SESSION["goods"] = $goods; //最后存一下购物车的内容

header("location:gwc.php");